package cn.wx.read.core.service;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.wx.read.core.entity.ScholarFos;
import cn.wx.common.persistence.base.BaseService;
import cn.wx.read.core.mapper.ScholarFosMapper;
import cn.wx.common.persistence.exception.MyException;
import cn.wx.common.persistence.web.ResponseCode;


/**
 * <p>
 *  服务类
 * </p>
 *
 * @author  
 * @since 2018-11-28
 */
@Service
@Transactional
public class ScholarFosService extends BaseService<ScholarFos, ScholarFosMapper> {
	
	
	/**
	 * 查询领域的总数
	 */
	public Integer countField() {
		return super.simpleMapper.countField();
	}
	
	 /**
	 * 修改
	 * @param scholarFos
	 * @return
	 * @throws MyException 
	 */
	public boolean modify(ScholarFos scholarFos) throws MyException{
		// PID 不能为空
		if (scholarFos.getpId() == null) {
			throw new MyException(ResponseCode.PARAMETER_REQUIRED);
		}
		return update(scholarFos);
	}
	
}
